home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / rbsetnv1.zip / MAKEFILE < prev    next >
Text File  |  1991-01-07  |  5KB  |  149 lines

  1. ###############################################################################
  2. # makefile for SETENV, EVAL and miscellaneous related bits - Turbo C
  3. #
  4. # This makefile runs under NDMAKE - needs editing with Borland make
  5. # It assumes no turboc.cfg, make.ini, makefile.mak or other accessories
  6. # It also assumes 4DOS as the shell - the "except" command in backup uses this
  7. # and various other pieces of syntax depend on this, but I'm sure you get
  8. # the idea.
  9. #                                R. Brittain, Jan 91
  10. ###############################################################################
  11.  
  12. .SUFFIXES : .doc .man .nro .obj .c .asm
  13. .RESPONSE_LINK : tlink
  14.  
  15. .c.obj:
  16.        $(CC) $(FLAGS) -D${DEFINES} -c $<
  17.  
  18. # use termansi if you can display the bold/underlining etc.
  19. # use termnull for plain ascii formatting
  20. .nro.doc:
  21.        ro -man $< | termnull > $@
  22.  
  23. CC     = tcc
  24. LINK   = c:\tc\tlink
  25. TC     = c:\tc
  26. LIBS   = $(TC)\lib
  27. FLAGS  = -f- -K -O -d -w- -I$(TC)\INCLUDE
  28.  
  29. # Optional defines:
  30. # DEBUG    for hacking - turns on miscellaneous debugging output,
  31. # SWITCH   to force subshells to use "/" instead of current switchar
  32. # FIXARG0  used by wildargv.c to put argv[0] in unix form
  33. # SORTARGS used by wildargv.c to sort all wildcard expansions
  34. # UNIXCOMPAT sets environment variable tag to $ instead of %
  35. #             and also disables upper-casing of environment variables (variables
  36. #             entered as typed on the command line)
  37. DEFINES= FIXARG0;SORTARGS
  38.  
  39. # Directories used by installation
  40.  
  41. BINDIR = C:\BIN
  42. MANDIR = C:\MAN\MAN1
  43.  
  44. #######################################################################
  45. # Compilation
  46. #######################################################################
  47.  
  48. JUNK   = *.obj *.bak *.i *.map junk*.*
  49. OBJCOMM   = wildargv.obj comsub.obj envfuncs.obj popen.obj getswitc.obj dup.obj
  50. OBJSETENV = setenv.obj  ${OBJCOMM}
  51. OBJEVAL   = eval.obj  ${OBJCOMM}
  52.  
  53. usual: setenv.exe eval.exe
  54.  
  55. examples : incr.com uprompt.com \
  56.           inspath.com  delpath.com addpath.com chgpath.com
  57.  
  58. all : usual examples
  59.  
  60. setenv.exe : $(OBJSETENV)
  61.         $(LINK) $(LIBS)\c0s $(OBJSETENV),setenv,,$(LIBS)\cs
  62.  
  63. eval.exe : $(OBJEVAL)
  64.         $(LINK) $(LIBS)\c0s $(OBJEVAL),eval,,$(LIBS)\cs
  65.  
  66. eval.obj setenv.obj : comsub.h
  67.  
  68. #######################################################################
  69. # Miscellaneous other utilities that use these routines
  70. # Included more as examples than really useful items
  71. #######################################################################
  72.  
  73. uprompt.com : uprompt.c envfuncs.c
  74.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -ouprompt uprompt.c
  75.                 exe2bin uprompt uprompt.com
  76.                 del uprompt.exe
  77.  
  78. incr.com : incr.c envfuncs.c
  79.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -oincr incr.c
  80.                 exe2bin incr incr.com
  81.                 del incr.exe
  82.  
  83. addpath.com : addpath.c envfuncs.c
  84.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -oaddpath addpath.c
  85.                 exe2bin addpath addpath.com
  86.                 del addpath.exe
  87.  
  88. delpath.com : delpath.c envfuncs.c
  89.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -odelpath delpath.c
  90.                 exe2bin delpath delpath.com
  91.                 del delpath.exe
  92.  
  93. chgpath.com : chgpath.c envfuncs.c
  94.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -ochgpath chgpath.c
  95.                 exe2bin chgpath chgpath.com
  96.                 del chgpath.exe
  97.  
  98. inspath.com : inspath.c envfuncs.c
  99.                 $(CC) -mt $(FLAGS) -D$(DEFINES) -oinspath inspath.c
  100.                 exe2bin inspath inspath.com
  101.                 del inspath.exe
  102.  
  103. #######################################################################
  104. # Maintenance
  105. #######################################################################
  106.  
  107. backup :
  108.        except ($(JUNK) mk0*.bat *.zoo *.zip) zoo aunP setenv *
  109.  
  110. distrib:
  111. #       zoo aunPP dist/setenv *.c *.h *.exe *.com *.doc *.nro makefile readme \
  112. #        tcconfig.tc eval.prj setenv.prj
  113.        pkzip -a dist/rbsetnv1 *.c *.h *.exe *.com *.doc *.nro \
  114.          makefile readme tcconfig.tc eval.prj setenv.prj
  115.  
  116. wrap   : backup clobber
  117.         except (*.zip *.zoo makefile) del -y *.*
  118.  
  119. unwrap :
  120.         zoo x// setenv
  121.  
  122. clean  :
  123.         del $(JUNK)
  124.  
  125. clobber : clean
  126.           -del setenv.exe eval.exe incr.com uprompt.com \
  127.           addpath.com inspath.com chgpath.com delpath.com
  128.  
  129. #######################################################################
  130. # Installation
  131. #######################################################################
  132.  
  133. install : $(BINDIR)\setenv.exe  $(BINDIR)\eval.exe \
  134.           $(MANDIR)\setenv.doc $(MANDIR)\eval.doc
  135.  
  136. $(MANDIR)\setenv.doc : setenv.doc
  137.        copy setenv.doc $(MANDIR)
  138.  
  139. $(MANDIR)\eval.doc : eval.doc
  140.        copy eval.doc $(MANDIR)
  141.  
  142. $(BINDIR)\setenv.exe : setenv.exe
  143.        copy setenv.exe $(BINDIR)
  144.  
  145. $(BINDIR)\eval.exe : eval.exe
  146.        copy eval.exe $(BINDIR)
  147.  
  148.  
  149.